varying vec3 normal, lightDir, eyeVec;

void main (void)
{
	vec4 final_color = vec4(0.2, 0.2, 0.0, 1.0);
							
	vec3 N = normalize(normal);
	vec3 L = normalize(lightDir);
	
	float lambertTerm = dot(N,L);

	vec4 LightSource = vec4 (1.0, 1.0, 1.0, 1.0);
	vec4 diffuse = vec4 (0.8, 0.8, 0.0, 1.0);
	vec4 specColor = vec4 (1.0, 1.0, 1.0, 1.0);
	float shininess = 50.0;
	
	if(lambertTerm > 0.0)
	{
		final_color += LightSource * diffuse * lambertTerm;
		              		
		vec3 E = normalize(eyeVec);
		vec3 R = reflect(-L, N);
		float specular = pow( max(dot(R, E), 0.0), shininess);
		final_color += LightSource * specColor * specular;
		               	
	}

	gl_FragColor = final_color;	
}
